
#ifndef PERSON_HPP
#define PERSON_HPP

typedef struct person{
	char name[256];
	char gender;
	void (*work)(struct person *pr);
	void (*delet)(struct person *pr);
}Person;

typedef struct student{
	Person stud_per;	// Inherit Person class
	char major[10];
	void (*graduate) (struct student *st);
}Student;

typedef struct under{
	Student under_st;	// Inherit Student class
	int year;
}Under;

typedef struct grad{
	Student grad_st;	// Inherit Student class 
	char degree[20];
}Grad;

typedef struct professor{
	Person prof_per;	// Inherit Person class
	char office[50];
	void (*research)(struct professor *, const char *topic);
}Professor;


Under* Under_new (const char *name, char gender, const char *major, int year);
Grad* Grad_new(const char *name, char gender, const char *major, const char *degree);
Professor* Professor_new (const char *name, char gender, const char *office);

Student* Person_downcast_Student (Person *pr);
Under* Person_downcast_Under (Person *pr);
Under* Student_downcast_Under (Student *st);
Grad* Person_downcast_Grad (Person *pr);
Professor* Person_downcast_Professor (Person *pr);
Grad* Student_downcast_Grad (Student *st);

#endif // End PERSON_HPP
